try:
    from djangoappengine.settings_base import *
    has_djangoappengine = True
except ImportError:
    has_djangoappengine = False
    DEBUG = True
    TEMPLATE_DEBUG = DEBUG

import os, sys

SECRET_KEY = '=r-$b*8hglm+858&9t043hlm6-&6-3d3vfc4((7yd0dbrakhvi'

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'lazysignup.middleware.LazySignupMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
#     'django.middleware.http.ConditionalGetMiddleware',
#     'django.middleware.gzip.GZipMiddleware',
)

INSTALLED_APPS = (
    'djangotoolbox',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.admin',
    'django.contrib.comments',
    'lazysignup',
    'registration',
    'profiles',
    'gift_list',
)

if has_djangoappengine:
    INSTALLED_APPS = ('djangoappengine',) + INSTALLED_APPS

AUTHENTICATION_BACKENDS = (
    'django.contrib.auth.backends.ModelBackend',
    'lazysignup.backends.LazySignupBackend',
)

TEST_RUNNER = 'djangotoolbox.test.CapturingTestSuiteRunner'

ADMIN_MEDIA_PREFIX = '/media/admin/'
MEDIA_ROOT = os.path.join(os.path.dirname(__file__), 'media')

ROOT_URLCONF = 'urls'

# added to allow for separation of local and 3rd party apps
LOCAL_APPS_DIR = 'apps'
EXTERNAL_APPS_DIR = 'external-apps'

# added by gafilson to enable some separation of local and 3rd party code
apps_dir = os.path.join(os.getcwd(), LOCAL_APPS_DIR)
external_apps_dir = os.path.join(os.getcwd(), EXTERNAL_APPS_DIR)
sys.path.insert(0, external_apps_dir)
sys.path.insert(0, apps_dir)

TEMPLATE_DIRS = (
    os.path.join(external_apps_dir, 'templates'),
    os.path.join(apps_dir, 'templates'),
    os.path.join(os.path.dirname(__file__), 'templates')
)
